import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class CallableLbh {
    static class l1 implements Callable {

        @Override
        public Integer call() throws Exception {
            return 1024;
        }
    }
    public static void main(String[] args) {
        l1 l2 = new l1();
        FutureTask futureTask = new FutureTask(l2);
        Thread thread = new Thread(futureTask);
        thread.start();
        while (!futureTask.isDone()) {
            System.out.println("wait...");
        }
        try {
            System.out.println("线程已进行完成，输出结果" + futureTask.get());
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (ExecutionException e) {
            e.printStackTrace();
        }
    }
}
